package com.cloudkinto.bo.order.outbound;

import com.cloudkinto.enumType.stock.StockOrderTypeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author long
 * @Description 扣减库存
 * @Date 2025/4/9 9:55
 */
@Data
public class DeductionOfInventoryBo {

    @ApiModelProperty("租户id")
    @NotNull(message = "租户id不能为空")
    private Long tenantId;

    @ApiModelProperty("客户id")
    @NotNull(message = "客户id不能为空")
    private Long companyId;

    @ApiModelProperty("仓库id")
    @NotNull(message = "仓库id不能为空")
    private Long whId;

    @ApiModelProperty("单据号")
    @NotEmpty(message = "单据号不能为空")
    private String orderNo;

    @ApiModelProperty("单据类型")
    @NotNull(message = "单据类型不能为空")
    private StockOrderTypeEnum orderType;

    @ApiModelProperty("sku信息")
    @NotNull(message = "sku信息不能为空")
    private List<SkuInfo> skuInfoList;

    @Data
    public static class SkuInfo {
        @ApiModelProperty("仓库产品id")
        @NotNull(message = "仓库产品id不能为空")
        private Long productId;

        @ApiModelProperty("数量")
        @NotNull(message = "数量不能为空")
        private Integer qty;
    }
}
